<?php

/**
 * This is the model class for table "produksikayutanah".
 *
 * The followings are the available columns in table 'produksikayutanah':
 * @property string $pkt_id
 * @property integer $pkt_kec
 * @property double $pkt_mahoni_batang
 * @property double $pkt_mahoni_m3
 * @property double $pkt_jati_batang
 * @property double $pkt_jati_m3
 * @property double $pkt_albasia_batang
 * @property double $pkt_albasia_m3
 * @property double $pkt_afrika_batang
 * @property double $pkt_afrika_m3
 * @property double $pkt_pinus_batang
 * @property double $pkt_pinus_m3
 * @property double $pkt_rbc_batang
 * @property double $pkt_rbc_m3
 * @property double $pkt_jumlah_batang
 * @property double $pkt_jumlah_m3
 * @property integer $pkt_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $pktKec
 */
class Produksikayutanah extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Produksikayutanah the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'produksikayutanah';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('pkt_kec, pkt_tahun', 'numerical', 'integerOnly'=>true),
			array('pkt_mahoni_batang, pkt_mahoni_m3, pkt_jati_batang, pkt_jati_m3, pkt_albasia_batang, pkt_albasia_m3, pkt_afrika_batang, pkt_afrika_m3, pkt_pinus_batang, pkt_pinus_m3, pkt_rbc_batang, pkt_rbc_m3, pkt_jumlah_batang, pkt_jumlah_m3', 'numerical'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('pkt_id, pkt_kec, pkt_mahoni_batang, pkt_mahoni_m3, pkt_jati_batang, pkt_jati_m3, pkt_albasia_batang, pkt_albasia_m3, pkt_afrika_batang, pkt_afrika_m3, pkt_pinus_batang, pkt_pinus_m3, pkt_rbc_batang, pkt_rbc_m3, pkt_jumlah_batang, pkt_jumlah_m3, pkt_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'pktKec' => array(self::BELONGS_TO, 'Kecamatan', 'pkt_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'pkt_id' => 'Pkt',
			'pkt_kec' => 'Pkt Kec',
			'pkt_mahoni_batang' => 'Pkt Mahoni Batang',
			'pkt_mahoni_m3' => 'Pkt Mahoni M3',
			'pkt_jati_batang' => 'Pkt Jati Batang',
			'pkt_jati_m3' => 'Pkt Jati M3',
			'pkt_albasia_batang' => 'Pkt Albasia Batang',
			'pkt_albasia_m3' => 'Pkt Albasia M3',
			'pkt_afrika_batang' => 'Pkt Afrika Batang',
			'pkt_afrika_m3' => 'Pkt Afrika M3',
			'pkt_pinus_batang' => 'Pkt Pinus Batang',
			'pkt_pinus_m3' => 'Pkt Pinus M3',
			'pkt_rbc_batang' => 'Pkt Rbc Batang',
			'pkt_rbc_m3' => 'Pkt Rbc M3',
			'pkt_jumlah_batang' => 'Pkt Jumlah Batang',
			'pkt_jumlah_m3' => 'Pkt Jumlah M3',
			'pkt_tahun' => 'Pkt Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('pkt_id',$this->pkt_id,true);
		$criteria->compare('pkt_kec',$this->pkt_kec);
		$criteria->compare('pkt_mahoni_batang',$this->pkt_mahoni_batang);
		$criteria->compare('pkt_mahoni_m3',$this->pkt_mahoni_m3);
		$criteria->compare('pkt_jati_batang',$this->pkt_jati_batang);
		$criteria->compare('pkt_jati_m3',$this->pkt_jati_m3);
		$criteria->compare('pkt_albasia_batang',$this->pkt_albasia_batang);
		$criteria->compare('pkt_albasia_m3',$this->pkt_albasia_m3);
		$criteria->compare('pkt_afrika_batang',$this->pkt_afrika_batang);
		$criteria->compare('pkt_afrika_m3',$this->pkt_afrika_m3);
		$criteria->compare('pkt_pinus_batang',$this->pkt_pinus_batang);
		$criteria->compare('pkt_pinus_m3',$this->pkt_pinus_m3);
		$criteria->compare('pkt_rbc_batang',$this->pkt_rbc_batang);
		$criteria->compare('pkt_rbc_m3',$this->pkt_rbc_m3);
		$criteria->compare('pkt_jumlah_batang',$this->pkt_jumlah_batang);
		$criteria->compare('pkt_jumlah_m3',$this->pkt_jumlah_m3);
		$criteria->compare('pkt_tahun',$this->pkt_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}